In a digital video camera, the image from the lens must at all times be focused directly on the photo sensor. If that is not done properly, the image will be blurry and more-or-less impossible to correct afterwards. There is commonly an auto-focus algorithm running that tries to analyze the image contents, and continuously adjust the focus lens to keep the image in focus. A common method for performing this auto-focus is the so called contrast detection auto-focus. Contrast detection auto-focus is widely used in digital video cameras of today.
Contrast detection auto-focus is achieved by measuring contrast within a sensor field, through the lens. The intensity difference between adjacent pixels of the sensor naturally increases with correct image focus. The optical system can thereby be adjusted until the maximum contrast is detected.
A difficulty for contrast detection auto-focus algorithms is that if the image suddenly becomes slightly blurry, for instance when zooming or panning, or if the lighting condition is poor, it is hard to determine if the lens shall be moved closer or further away. If moving in the wrong direction, the image will become even more blurry, and potentially important video information is irrecoverably lost. In the worst case, the digital video camera loses track of the correct focus position altogether, resulting in the necessity of a full focus sweep to find the correct focus position again. Such a sweep might take several seconds to complete, during which the video will be more or less useless.